#import <Foundation/Foundation.h>

/*
    This class uses NSXMLParser to map the contents of an XML document to Objective-C model objects.
    It encodes specific knowledge of the XML document being parsed in this sample, which is provided
    by the U.S. Geological Survey at this URL: http://earthquake.usgs.gov/eqcenter/catalogs/7day-M2.5.xml
    
    This sample parses that particular XML file, so you'll need to change it
    to work with the XML document your application uses. 
 
    The USGS RSS feed includes all recent magnitude 2.5 and greater earthquakes world-wide, 
    and represents each earthquake with an <entry> element, such as this:
 
    <entry>
        <id>urn:earthquake-usgs-gov:us:2008rkbc</id>
        <title>M 5.8, Banda Sea</title>
        <updated>2008-04-29T19:10:01Z</updated>
        <link rel="alternate" type="text/html" href="/eqcenter/recenteqsww/Quakes/us2008rkbc.php"/>
        <link rel="related" type="application/cap+xml" href="/eqcenter/catalogs/cap/us2008rkbc"/>
        <summary type="html">
            <img src="http://earthquake.usgs.gov/images/globes/-5_130.jpg" alt="6.102&#176;S 127.502&#176;E" align="left" hspace="20" /><p>Tuesday, April 29, 2008 19:10:01 UTC<br>Wednesday, April 30, 2008 04:10:01 AM at epicenter</p><p><strong>Depth</strong>: 395.20 km (245.57 mi)</p>
        </summary>
        <georss:point>-6.1020 127.5017</georss:point>
        <georss:elev>-395200</georss:elev>
        <category label="Age" term="Past hour"/>
    </entry>
 
    When NSXMLParser encounters an <entry> element, it invokes the delegate method parser:didStartElement:namespaceURI:qualifiedName:attributes:.
    This sample's implementation of that method instantiates an instance of the Earthquake class and adds it to the list of objects
    that the application's delegate manages.
 
    When NSXMLParser reports an element other than an <entry> element, in parser:didStartElement:namespaceURI:qualifiedName:attributes:
    this sample allocates an NSMutableString and sets the contentOfCurrentEarthquakeProperty property, which is used to hold
    the content of child elements of the current <entry> element.
 
    For example, if the current element is <title>, the sample creates a mutable string for the contentOfCurrentEarthquakeProperty property.
    When NSXMLParser reports that it found characters in the parser:foundCharacters: delegate method, those characters are 
    appended to the contentOfCurrentEarthquakeProperty mutable string. 
 
    When the parser finishes processing an element, it invokes the delegate method 
    parser:didEndElement:namespaceURI:qualifiedName:. At that point, the sample sets the value of the property in the current
    Earthquake object (the currentEarthquakeObject property) to the value of the contentOfCurrentEarthquakeProperty string.

*/

@interface XMLReader : NSObject {

@private        
    NSMutableDictionary *userList;
	NSString *pid;
	NSMutableString *elementContent;
	NSString *currentId;
	NSString *serverError;
	NSString *vcard;
}

@property (nonatomic, retain) NSMutableDictionary *userList;
@property (nonatomic, retain) NSString *pid;
@property (nonatomic, retain) NSMutableString *elementContent;
@property (nonatomic, retain) NSString *currentId;
@property (nonatomic, retain) NSString *serverError;
@property (nonatomic, retain) NSString *vcard;

- (void)parseXML:(NSString *)xml parseError:(NSError **)error;

@end
